<include file="Common/header"  />


<div class="app" data-sidebar="locked">
    <!-- top header -->
    <include file="Common/header_nav" />
    <!-- /top header -->



    <section class="layout">
        <!-- sidebar menu -->
        <include file="Common/left_aside"  />
        <!-- /sidebar menu -->
        <aside class="canvas-right sidebar-300 bg-default">
            <div class="content-wrap">
                <div class="profile pd-l-md pd-r-md pd-b-lg">

                    <div class="row">
                        <div class="col-xs-12 profile-cover">
                            <div class="profile-avatar text-center">
                                <img src="__ROOT__/Public/asset/img/face.jpg" class="avatar avatar-lg bordered-avatar img-circle" alt="">
                            </div>
                        </div>
                        <div class="col-xs-12 text-center mg-t-md">
                            <div class="h4 no-margin">{$userinfo.username}</div>
                            <small>心秘籍小组</small>
                        </div>
                        <div class="col-xs-12 mg-t-md mg-b-md">
                            <div class="btn-group btn-group-justified btn-rounded">
                                <a class="btn btn-success" role="button" href="/Home/UserInfo/edit">编辑个人资料</a>
                                <a class="btn btn-primary" role="button">查看账户信息</a>
                            </div>
                        </div>
                    </div>

                    <div class="row">
                        <div class="col-xs-12 mg-b-sm">
                            邮箱
                            <span class="pull-right">{$userinfo.email}</span>
                        </div>
                        <div class="col-xs-12 mg-b-sm">
                            我的组织
                            <span class="pull-right">心秘籍小组</span>
                        </div>
                        <div class="col-xs-12">
                            做过的测试数
                            <span class="pull-right">1</span>
                        </div>
                        <hr>
                    </div>

                    <div class="row mg-b mg-t">
                        <div class="col-xs-12">

                            <article>欢迎使用心秘籍，让我们打造一个更好的自己吧！</article>
                        </div>
                    </div>

                    <a href="javascript:;" class="text-muted">
                        <i class="fa fa-globe mg-r-md"></i>www.xinqiji.co</a>
                </div>
            </div>
        </aside>
        <!-- chat panel -->
        <aside class="chat-sidebar canvas-right pull-right">
            <div class="slimscroll" data-height="auto" data-size="6px" data-distance="0">

                <div class="row text-white pd-md">
                    <div class="col-xs-8">
                        <p class="mg-t-xs">Mute notifications</p>
                    </div>
                    <div class="col-xs-4">
                        <input type="checkbox" class="js-switch" checked />
                    </div>
                </div>

                <b class="center-block text-white pd-md">
                    Activity feed
                </b>

                <div class="pd-md">
                    <a href="javascript:;" class="pull-left mg-r-md">
                            <span class="fa-stack fa-lg">
                                <i class="fa fa-circle fa-stack-2x text-warning"></i>
                                <i class="fa fa-download fa-stack-1x fa-inverse"></i>
                            </span>
                    </a>
                    Rose Fournier
                    <small>Posted on to your wall</small><br>
                    <small>2 mins ago</small>
                </div>

                <div class="pd-md">
                    <a href="javascript:;" class="pull-left mg-r-md">
                            <span class="fa-stack fa-lg">
                                <i class="fa fa-circle fa-stack-2x text-danger"></i>
                                <i class="fa fa-download fa-stack-1x fa-inverse"></i>
                            </span>
                    </a>
                    Liviu Cîndea
                    <small>Shared a photo with you.</small><br>
                    <small>13 mins ago</small>
                </div>

                <div class="pd-md">
                    <a href="javascript:;" class="pull-left mg-r-md">
                            <span class="fa-stack fa-lg">
                                <i class="fa fa-circle fa-stack-2x text-success"></i>
                                <i class="fa fa-download fa-stack-1x fa-inverse"></i>
                            </span>
                    </a>
                    Ane Marín
                    <small>Left the group(HR)</small><br>
                    <small>4 days ago</small>
                </div>

                <b class="center-block text-white pd-md">
                    Favourites
                </b>

                <div class="pd-md">
                    <a href="javascript:;" class="pull-left mg-r-md">
                        <img src="__ROOT__/Public/asset/img/faceless.jpg" class="avatar avatar-sm img-circle" alt="">
                    </a>
                    <div class="user">
                        Adi Afrom
                        <i class="fa fa-circle text-danger pull-right"></i>
                    </div>
                    <small>Offline</small>
                </div>

                <div class="pd-md">
                    <a href="javascript:;" class="pull-left mg-r-md">
                        <img src="__ROOT__/Public/asset/img/faceless.jpg" class="avatar avatar-sm img-circle" alt="">
                    </a>
                    <div class="user">
                        Leonie Horn
                        <i class="fa fa-circle text-danger pull-right"></i>
                    </div>
                    <small>Offline</small>
                </div>

                <b class="center-block text-white pd-md">
                    Friends Online
                </b>

                <div class="pd-md">
                    <a href="javascript:;" class="pull-left mg-r-md">
                        <img src="__ROOT__/Public/asset/img/faceless.jpg" class="avatar avatar-sm img-circle" alt="">
                    </a>
                    <div class="user">
                        Joshua Smart
                        <i class="fa fa-circle text-warning pull-right"></i>
                    </div>
                    <small>is thinking of bananas</small>
                </div>

                <div class="pd-md">
                    <a href="javascript:;" class="pull-left mg-r-md">
                        <img src="__ROOT__/Public/asset/img/faceless.jpg" class="avatar avatar-sm img-circle" alt="">
                    </a>
                    <div class="user">
                        娉 廖
                        <i class="fa fa-circle text-success pull-right"></i>
                    </div>
                    <small>Ready to chat</small>
                </div>

                <div class="pd-md">
                    <a href="javascript:;" class="pull-left mg-r-md">
                        <img src="__ROOT__/Public/asset/img/faceless.jpg" class="avatar avatar-sm img-circle" alt="">
                    </a>
                    <div class="user">
                        Albert Madsen
                        <i class="fa fa-circle-o text-default pull-right"></i>
                    </div>
                    <small>idle</small>
                </div>
            </div>
        </aside>
        <!-- /chat panel -->

        <!-- main content -->
        <section class="main-content">

            <!-- content wrapper -->
            <div class="content-wrap">

                <div class="row">
                    <div class="col-md-6">
                        <div class="row">

                            <div class="col-md-12 col-xs-12">
                                <div class="panel panel-primary">
                                    <div class="panel-heading" >
                                        <div class="row">
                                            <div class="col-md-3 col-center">
                                                <i class="fa fa-pencil fa-5x"></i>
                                            </div>

                                        </div>
                                    </div>
                                    <a href="#">
                                        <div class="panel-footer">
                                            <span class="pull-left"><a href="/Home/MyQuiz" class="start-label" >进入测试</a></span>
                                            <span class="pull-right"><i class="fa fa-arrow-circle-right fa-3x"></i></span>
                                            <div class="clearfix"></div>
                                        </div>
                                    </a>
                                </div>
                            </div>

                            <div class="col-md-12 col-xs-12">
                                <div class="panel panel-success">
                                    <div class="panel-heading">
                                        <div class="row">
                                            <div class="col-xs-3 col-center">
                                                <i class="fa fa-file-text-o fa-5x"></i>
                                            </div>

                                        </div>
                                    </div>
                                    <a href="#">
                                        <div class="panel-footer">
                                            <span class="pull-left"><a href="/Home/MyQuiz/MyReport" class="start-label">我的报告</a></span>
                                            <span class="pull-right"><i class="fa fa-arrow-circle-right fa-3x"></i></span>
                                            <div class="clearfix"></div>
                                        </div>
                                    </a>
                                </div>
                            </div>

                        </div>
                    </div>
                    <div class="col-md-6 col-sm-12 col-xs-12">

                        <section class="panel panel-primary post bg-primary">
                            <div class="panel-heading">
                                <i class="fa fa-pencil pd-r-sm"></i>正在进行的测试&nbsp<span id="quiz_notification"></span>
                            </div>

                            <ul class="list-group bg-none">
                                <li class="list-group-item" id="quiz_status_content">
                                    载入中
                                </li>
                            </ul>
                        </section>

                        <section class="panel no-border">
                            <div class="panel-heading no-border">

                                <div><h4>心秘籍</h4>
                                    <small class="pull-right">
                                        <a class="fa fa-chevron-down panel-collapsible pd-r-xs" href="javascript:;"></a>

                                        <a class="fa fa-times panel-remove" href="javascript:;"></a>
                                    </small>
                                </div>
                                <small>快来更好地了解自己吧</small>
                            </div>
                            <div class="panel-body no-padding">
                                <div class="imgpost-heading">
                                    <ul class="bxslider">
                                        <li>
                                            <div class="cover" style="background-image: url(__ROOT__/Public/asset/img/cover2.jpg)"></div>
                                        </li>
                                        <li>
                                            <div class="cover" style="background-image: url(__ROOT__/Public/asset/img/cover4.jpg)"></div>
                                        </li>
                                    </ul>
                                </div>

                            </div>
                        </section>

                        <div class="panel panel-color">
                            <div class="panel-heading">
                                系统公告
                                <small class="pull-right text-white">
                                    <a class="fa fa-chevron-down panel-collapsible pd-r-xs" href="javascript:;"></a>
                                    <a class="fa fa-times panel-remove" href="javascript:;"></a>
                                </small>
                            </div>
                            <div class="panel-body">
                                心奇迹系统建设中<br>心奇迹系统建设中<br>心奇迹系统建设中<br>心奇迹系统建设中<br>心奇迹系统建设中<br>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <!-- /content wrapper -->
        </section>
        <!-- /main content -->

    </section>

</div>

<include file="Common/footer" />

<include file="Index/scripts" />

<script>

    $(document).ready(function(){


        $.ajax({
            type:"GET",
            url:"/Home/Index/isOrg",
            dataType:"json",
            async : false,
            success:function(data){

                if (data.code == 0){
                    $("#li-org").hide();
                }

            },error: function (jqXHR) {
                alert("获取组织者权限failed"+jqXHR.status);
            }
        });

        $.ajax({
            type:"GET",
            url:"/Home/Index/getQuizList",
            dataType:"json",
            async : false,
            success:function(data){

                var htmls = [];
                if(data.orgnizer == 0){
                    htmls.push('<label>普通用户测试</label>');
                }
                else if(data.orgnizer == 1){
                    
                    $("#quiz_notification").html('<div class="badge badge-top bg-danger animated flash">'+Object.keys(data.detail).length+'</div>');
                    
                    for (var i = 0; i < Object.keys(data.detail).length; i++){
                        htmls.push('<label>'+data.detail[i].quiz_title+' 由'+data.orgnizer_name+'发起 <a href="/Home/StartQuiz/doquiz?quiz_id='+data.detail[i].quiz_id+'">继续测试</a> </label>');
                        htmls.push('<small class="center-block">完成了'+data.detail[i].percent+'%</small>')
                    }
                }
                
                
                else{
                    htmls.push('<label>16pf人格测试  <a href="/Home/StartQuiz/doquiz">继续测试</a> </label>')
                    htmls.push('<small class="center-block">完成了'+data.pf16_percent+'%</small>')
                }

                $("#quiz_status_content").html(htmls.join(''));

            },error: function (jqXHR) {
                alert("failed"+jqXHR.status);
            }
        });
    });

</script>